package junit.com.cpi.cornpp.customer.dao;

import java.util.Collection;

import junit.framework.TestCase;
import KC.ModSegApp.UsuarioApp;

import com.cpi.cornpp.customer.dao.CustomerDAO;
import com.cpi.cornpp.customer.dto.CustomerDTO;
import com.cpi.cornpp.customer.exception.CustomerException;

public class CustomerDAOTest extends TestCase {

	private static final String VALID_CUSTOMER = "ar";
	UsuarioApp usuario;
	CustomerDAO customerDAO;
	CustomerDTO customerDTO;
	
	public CustomerDAOTest(String name) {
		super(name);
	}
	
	protected void setUp() throws Exception {
		super.setUp();
		customerDAO = new CustomerDAO();
		customerDTO = new CustomerDTO();
	}

	protected void tearDown() throws Exception {
		super.tearDown();
	}

	public void testGetCustomers() {
		
		customerDTO.setDescription(VALID_CUSTOMER);
		Collection customers = null;
		
		try {		
			
			customers = customerDAO.getCustomers(customerDTO);			
			assertNotNull(customers);
		} catch (CustomerException e) {
			fail(e.getMessage());
		}
	}

}
